clippedShadow
Creates a shadow replacement with the interior artifact clipped out.
Refer to shadow's docs for parameter details.
NB: On API levels 24..28, these shadows are clipped to the root Composable's bounds.
A clippedShadow overload that can be tinted with the library's color compat mechanism on API levels before 28, the earliest version to support the native shadow colors.
Refer to shadow's docs for details on the first five parameters: elevation, shape, clip, ambientColor, and spotColor.
colorCompat takes a Color that's used to tint the shadow on API levels 27 and below. If the passed value is Color.Black – the default shadow color – no tint is applied. If Color.Unspecified is passed, the actual tint is calculated as a blend of the ambientColor and spotColor, mixed in proportion to their current theme alphas. Setting any other value disables this blending behavior.
forceColorCompat is available to enable the effect on API levels 28 and above.
The color blending formula gives good results only if the ambient and spot colors are both fully opaque; i.e., only if both have maximum alpha values.
NB: On API levels 24..28, these shadows are clipped to the root Composable's bounds. Shadows using color compat have the same restriction on all API levels.
The lambda version of clippedShadow that allows for modification of shadow properties without recomposition.
shape works like normal. clip defaults to true instead of elevation > 0.dp, since that value isn't set until the lambda runs.
The rest of the original parameters – elevation, ambientColor, spotColor, colorCompat, and forceColorCompat – are now inside block.
NB: On API levels 24..28, these shadows are clipped to the root Composable's bounds. Shadows using color compat have the same restriction on all API levels.